package com.mvc.service;

import com.mvc.beans.Admin;
import com.mvc.dao.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author a1926
 */
@Service
public class LoginServiceImp implements LoginService {


    private Login login;
    @Autowired
    public void setLogin(Login login) {
        this.login = login;
    }

    @Override
    public Boolean loginCheck(Admin admin) {
        return admin.getPassWord().equals(login.getAdmin(admin.getAdminId()).getPassWord());
    }

    @Override
    public Integer addAdmin(Admin admin) {
        return login.addAdmin(admin);
    }
}
